package com.bjtu.boatmq.broker.service.request;

import com.bjtu.boatmq.broker.service.outer.BrokerLogger;
import com.bjtu.boatmq.common.protocol.PacketSource;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
// 暂时不使用
public class RequestHandle extends ChannelInboundHandlerAdapter{
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object ps) throws Exception {
        super.channelRead(ctx, ps);
        if(ps instanceof PacketSource){
            PacketSource requestPacket = (PacketSource)ps;
            System.out.println("收到PacketSource数据包");
            ctx.writeAndFlush(requestPacket);
        }else{
            BrokerLogger.write("10041","收到未知消息");
        }
    }
}
